| Conditions | 3 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import { toggleMark } from 'prosemirror-commands'; |
||
| 38 | getMenuItem(schema) { |
||
| 39 | if (!this.isAvailable(schema)) { |
||
| 40 | throw new Error(`Mark ${this.markType} is not available in Schema!`); |
||
| 41 | } |
||
| 42 | |||
| 43 | return new MenuItem({ |
||
| 44 | command: toggleMark(schema.marks[this.markType]), |
||
| 45 | icon: svgIcon(this.iconName), |
||
| 46 | label: this.title, |
||
| 47 | isActive: editorState => MarkMenuItemDispatcher.markActive(editorState, schema.marks[this.markType]), |
||
| 48 | }); |
||
| 49 | } |
||
| 50 | } |
||
| 51 |